package com.forezp.service;

import com.forezp.dao.TaskDao;
import com.forezp.entity.DataSource;
import com.forezp.entity.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * springboot-jdbc-DataSourceService
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/3/16 14:16
 */
@Service
public class TaskService {

    @Autowired
    private TaskDao taskDao;

    public List<Task> getAll() {
        return taskDao.findAll();
    }

    public Task findById(Integer taskId) {
        return taskDao.getOne(taskId);
    }

    public void del(Integer id) {
        this.taskDao.delete(id);
    }

    public void save(Task task) {
        this.taskDao.save(task);
    }
}
